<template lang="html">
  <div class="dynamic">
    <banner :imgUrl="imgUrl"></banner>
    <list></list>
  </div>
</template>

<script>
import Banner from 'components/index/banner/banner'

import {getGroupData} from 'api/article.js'

import List from 'components/index/list/list'

export default {
  components: {
    Banner,
    List
  },
  data() {
    return {
      imgUrl: require('./banner.jpg'),
      data: [],
      total: 0
    }
  },
  created() {
    let zone = this.$route.params.zone
    if (zone) {
      this._getGroupData(zone)
    } else {
      this._getGroupData('zixun')
    }
  },
  methods: {
    _getGroupData(tag) {
      getGroupData(tag).then((res) => {
        this.data = res.data
      })
    },
    toDetail(id) {
      this.$router.push('/index/dynamic-detail/' + id)
    }
  }
}
</script>

<style lang="scss" scoped>
.dynamic{
  width: 100%;
  margin-bottom: 100px;
  .block{
    text-align: center;
  }
}
</style>
